package cn.lyq.card.ui.rank

import androidx.lifecycle.MutableLiveData
import cn.lyq.card.base.SimpleVM
import cn.lyq.card.data.model.RankTypeInfo


class RankVM : SimpleVM() {

    val mTypeInfo = MutableLiveData<RankTypeInfo>()

    fun getRankType() = simpleEmit {
        repository.rankService.getRankType()
    }

    fun getRankList(type: Int) = simpleEmit {
        val typeId = mTypeInfo.value?.id ?: 0
        repository.rankService.getRankList(typeId, type)
    }
}